<?php
/**
 * Created by PhpStorm.
 * User: chy
 * Date: 2017/11/24
 * Time: 上午10:18
 */?>
<?php
/**
 * Created by PhpStorm.
 * User: chy
 * Date: 2017/10/12
 * Time: 下午4:34
 */?>
<html  lang="utf-8">
<?php $this->load->helper('url');?>
<head>
    <script language="javascript" type="text/javascript" src="<?php echo base_url()?>js/bootstrap.min.js"></script>
    <link href="<?php echo base_url()?>css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo base_url()?>css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <title>修改密码-管理员</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
    <link href="<?php echo base_url()?>css/general.css" rel="stylesheet" type="text/css" />

    <link href="<?php echo base_url()?>css/main.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="<?php echo base_url()?>js/jquery.js"></script>
    <script language="JavaScript"> var base_url = '<?php echo base_url()?>'; </script>
    <script language="javascript" type="text/javascript" src="<?php echo base_url()?>js/admin.js"></script>
</head>
<script>
    function checkpass(){

        var x=document.forms["updatepassword"]["user_oldpass"].value;
        var y=document.forms["updatepassword"]["user_newpass"].value;
        var z=document.forms["updatepassword"]["user_newpass_1"].value;
        if (x==null || x==""){
            alert("旧密码必须填写");
            return false;
        }
        if (y==null || y==""){
            alert("新密码必须填写");
            return false;
        }
        if (z==null || z==""){
            alert("确认新密码");
            return false;
        }
        if (window.confirm("是否确认修改密码")) {
            return true;
        }
        return false;
    }
</script>
<body  class=" x-border-layout-ct" style="position: relative;" >
<div class="container">

    <div class="row">
        <div class="col-md-8">
            <h1>Bacteria</h1>
        </div>
    </div>
</div>
<div class="container navigation">
    <div class="row" style="background-color: <?php if($_SESSION['role_id']==1) echo "#ff8000"; else if($_SESSION['role_id']==0) echo "#E82030";?>;font-size: 25px">
        <div class="col-md-8">
            <form action="<?php echo site_url('c_data/')?>" method="post" >
                <input id="inputSuccess" type="hidden" name="session_user_id" value="<?php echo $_SESSION['user_id']; ?>"/>
                <input id="inputSuccess" type="hidden" name="session_user_name" value="<?php echo $_SESSION['user_name']; ?>"/>
                <input id="inputSuccess" type="hidden" name="session_role_id" value="<?php echo $_SESSION['role_id']; ?>"/>
                <input id="inputSuccess" type="hidden" name="session_logged_in" value="<?php echo $_SESSION['logged_in']; ?>"/>
                <input style="width: 80px;height: 30px;background: <?php if($_SESSION['role_id']==1) echo "#ff8000"; else if($_SESSION['role_id']==0) echo "#E82030";?>;color: white" class="btn btn-default" type=submit name="session_manage" value="首页"/>
            </form>
        </div>
        <div class="col-xs-2">
            <a style="color: white; font-size: 14px;">
                <?php echo $_SESSION['user_id']." ".$_SESSION['user_name'];?>
            </a>
        </div>
        <div class="col-xs-2">
            <a href='<?php echo site_url('c_login/logout');?>' style="color: white; font-size: 14px;">退出登录</a>
        </div>
    </div>

    <br/>

    <h4 style="text-align: center">修改信息</h4>
    <br/>
    <form name="updatepassword" method="POST"  onsubmit="return checkpass()" action="<?php echo site_url('c_user_manage/update_password/'.$_SESSION['user_id']);?>" style="text-align: center">
        <input id="inputSuccess" type="hidden" name="session_user_id" value="<?php echo $_SESSION['user_id']; ?>"/>
        <input id="inputSuccess" type="hidden" name="session_user_name" value="<?php echo $_SESSION['user_name']; ?>"/>
        <input id="inputSuccess" type="hidden" name="session_role_id" value="<?php echo $_SESSION['role_id']; ?>"/>
        <input id="inputSuccess" type="hidden" name="session_logged_in" value="<?php echo $_SESSION['logged_in']; ?>"/>
        旧密码: <input type="password" name="user_oldpass" value="">

        <br><br>
        新密码: <input type="password" name="user_newpass" value="">

        <br><br>
        再次确认: <input type="password" name="user_newpass_1" value="">

        <br><br>
        <input style="width: 80px;height: 30px;background: <?php if($_SESSION['role_id']==1) echo "#ff8000"; else if($_SESSION['role_id']==0) echo "#E82030";?>;color: white" class="btn btn-default" type="submit" name="submit" value="提交" >
    </form>
    <?php echo $return;?>
    <div class="row" style="background-color: <?php if($_SESSION['role_id']==1) echo "#ff8000"; else if($_SESSION['role_id']==0) echo "#E82030";?>;font-size: 25px">
        <div align="center" style=" text-align: center"><h6 align="center" style="text-align: center;color: <?php if($_SESSION['role_id']==1) echo "#ff8000"; else if($_SESSION['role_id']==0) echo "#E82030";?>;">bacteria </h6></div>
    </div>
</div>
</body>
</html>
